# -*- coding: utf-8 -*-
# @Time : 2025/2/27 10:16
# @Author : debbyszhang
# @File : new_gateway.py
# @desc :
import allure
from playwright.sync_api import expect

from libs.tools import utils
from pageObject.cross_gateway_list_page import CrossGatewayListPage


@allure.feature("新建跨链事件配置")
class TestNewEvent:

    def test_new_event(self, page):
        cross_gateway_page = CrossGatewayListPage(page)
        topic, target_gateway_id, target_chainrid, target_contract, try_method = 't' + utils.getCurrentMintus(), 'MAIN_GATEWAY_ID00', 'relayer', 'batchContract', 'try'
        cross_gateway_page.new_event(topic, target_gateway_id, target_chainrid, target_contract, try_method)
        t = cross_gateway_page.page.locator("#tea-message-root div").inner_text()
        print(t)  # '配置成功'
        assert t == '配置成功'
        # expect(page.get_by_role("cell", name=gateway_name).locator("div")).to_be_visible()
